package com.atguigu.entity;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author : wenchao.long
 * @date : Created in 2020/11/11 19:42 周三
 * @description :
 *         <p>
 *         将配置文件中配置的每一个属性的值，映射到这个组件中
 *         ·@ConfigurationProperties 告诉SpringBoot将本类中的所有属性和配置文件
 *         相关的配置进行绑定
 *         并且这个组件是容器中的组件，才能给容器提供@ConfigurationProperties功能
 *         </p>
 */
@Data
@ConfigurationProperties(prefix = "person")
@Component
@Validated
public class Person {

    private String lastName;
    private Integer age;
    private Boolean boss;
    private Date birth;
    private Map<String, Object> maps;
    private List<Object> lists;
    private Dog dog;
}
